﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Animation;

namespace S7.UserControls
{
    /// <summary>
    /// Interaction logic for Chair.xaml
    /// </summary>
    public partial class Chair : UserControl
    {
        public Chair()
        {
            InitializeComponent();
        }
        public string CustomerName
        {
            get { return tbInfo1.Text; }
            set { tbInfo1.Text = value; }
        }
        public string Info2
        {
            get { return tbInfo2.Text; }
            set { tbInfo2.Text = value; }
        }
        public string Info3
        {
            get { return tbInfo3.Text; }
            set { tbInfo3.Text = value; }
        }
        public string Info4
        {
            get { return tbInfo4.Text; }
            set { tbInfo4.Text = value; }
        }

        private int _CustomerID;

        public int CustomerID
        {
            get { return _CustomerID; }
            set { _CustomerID = value; }
        }

        public void ShowMessage(string msg)
        {
            tbBubbleMessage.Text = msg;
            var sb = (Storyboard)Resources["sbBubbleFadeIn"];
            sb.Begin(this);
        }

        private void SignCustomerOut_Click(object sender, RoutedEventArgs e)
        {
            //var cons = from table in Table.lstTables
            //           from con in Info.server.con
            //           where table.TableID.Equals(con.Value.current.TableID)
            //           select con.Value.current.customers;

            //M7.NCustomer cust = new M7.NCustomer();
            //cust.Username = CustomerName;
            //M7.Msg msg = new M7.Msg();
            //SendMsg
        }

        private void ShowOrders_Click(object sender, RoutedEventArgs e)
        {
            //edy
        }

        public enum Waiting
        {
            Waiter,
            Order,
            WC,
            Cab,
            Online,
            Offline,

        }
        public void ChangeColor(Waiting w)
        {
            switch (w)
            {
                case Waiting.Waiter:
                    eChair.Fill = (Brush)Application.Current.Resources["bWaiter"];
                    break;
                case Waiting.Order:
                    eChair.Fill = (Brush)Application.Current.Resources["bOrder"];
                    break;
                case Waiting.WC:
                    eChair.Fill = (Brush)Application.Current.Resources["bWC"];
                    break;
                case Waiting.Cab:
                    eChair.Fill = (Brush)Application.Current.Resources["bCab"];
                    break;
                case Waiting.Online:
                    eChair.Fill = (Brush)Application.Current.Resources["bOnline"];
                    break;
                case Waiting.Offline:
                    eChair.Fill = (Brush)Application.Current.Resources["bOffline"];
                    break;
            }
        }
    }
}
